package com.ruoyi.runner;

import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysDictTypeService;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Order(Ordered.LOWEST_PRECEDENCE - 1)
@Component
@RequiredArgsConstructor
public class SystemRunner implements CommandLineRunner {

    private final ISysConfigService sysConfigService;
    private final ISysDictTypeService sysDictTypeService;

    @Override
    public void run(String... args) throws Exception {
        sysConfigService.loadingConfigCache();
        sysDictTypeService.loadingDictCache();

    }
}
